function counter(zimu) {
    return new Promise((resolve, reject) => {
        // 输出1~10，每次休息1s
        resolve(zimu)
    })
}

counter('a').then(result => {
    for (let i = 1; i <= 10; i++) {
        setTimeout(() => {
            console.log(`${result}${i}`)
        }, 1000 * i)
    }
})

counter('b').then(result => {
    for (let i = 1; i <= 10; i++) {
        setTimeout(() => {
            console.log(`${result}${i}`)
        }, 1000 * i)
    }
})

counter('c').then(result => {
    for (let i = 1; i <= 10; i++) {
        setTimeout(() => {
            console.log(`${result}${i}`)
        }, 1000 * i)
    }
})
